package com.seamtop.cuber.server.service.impl;

import com.seamtop.cuber.common.base.DataObject;
import com.seamtop.cuber.common.metadata.TableMetaData;
import com.seamtop.cuber.server.service.ClusterRecordsService;
import com.seamtop.cuber.server.service.ClusterStateService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * Created by zongjunfeng on 2015/9/16.
 */
@Service
public class ClusterRecordsServiceImpl implements ClusterRecordsService {

    private static final Logger LOG = LoggerFactory.getLogger(ClusterRecordsServiceImpl.class);

    @Override
    public Integer getTableTotalRecords(String tableName) {
        TableMetaData tableMetaData = DataObject.getMetaDataMap().get(tableName);
        if(tableMetaData == null){
            LOG.error("Get table["+tableName+"] error,table is not exist!");
            return null;
        }
        System.out.println("prefix:"+tableMetaData.getTablePrefix());
        return null;
    }
}
